<!DOCTYPE html>
<html>
<head>
    <title></title>
    <#include "/header.html">
    <!--选中行高亮-->
    <style>
        .el-radio__inner{
            display: none;
        }
    </style>
</head>

<body>
<div id="rrapp" v-cloak>
    <!--图文宝月结订单列表-->
    <div>
        <el-row style="margin-top: 5px">
            <el-col :span="8">
                <el-row>
                <el-col :span="4">
                <span style="color: #1ab7ea">订单状态:</span>
                </el-col>
                 <el-col :span="20">
                <div class="grid-content bg-purple">
                    <el-radio-group v-model="q.productionStatus" @change="query">
                        <el-radio :label="''">全部</el-radio>
                        <el-radio :label="3">生产中</el-radio>
                        <el-radio :label="4">生产完成</el-radio>
                        <el-radio :label="6">已完成</el-radio>
                    </el-radio-group>
                </div>
                 </el-col>
                </el-row>
            </el-col>
            <el-col :span="8">
                <el-row>
                    <el-col :span="4">
                        <span style="color: #1ab7ea">付款状态:</span>
                    </el-col>
                    <el-col :span="20">
                        <div class="grid-content bg-purple">
                            <el-radio-group v-model="q.payStatus" @change="query">
                                <el-radio :label="''">全部</el-radio>
                                <el-radio :label="'0'">未付款</el-radio>
                                <el-radio :label="1">已收银订单</el-radio>
                            </el-radio-group>
                        </div>
                    </el-col>
                </el-row>
            </el-col>
            <el-col :span="8">
                <el-row>
                    <el-col :span="4">
                        <span style="color: red">销售统计:</span>
                    </el-col>
                    <el-col :span="20">
                        <span>应收金额:{{totalMoney}}</span>
                    </el-col>
                </el-row>
            </el-col>
        </el-row>
        <el-row style="margin-top: 20px" >
        <!--查询-->
        <el-input placeholder="订单号" size="small" clearable  v-model.trim="q.orderNo" style="width:180px" @keyup.enter.native="query">
        </el-input>
            <el-input placeholder="客户名称" size="small" clearable  v-model.trim="q.memberName" style="width:100px" @keyup.enter.native="query">
            </el-input>
            <el-input placeholder="项目名称" size="small" clearable  v-model.trim="q.projectName" style="width:130px" @keyup.enter.native="query">
            </el-input>
        <el-date-picker
                size="small"
                value-format="yyyy-MM-dd HH:mm:ss"
                v-model="q.startTime"
                type="datetime"
                style="width: 180px"
                placeholder="下单时间开始">
        </el-date-picker>
        &nbsp;至&nbsp;
        <el-date-picker
                size="small"
                v-model="q.endTime"
                type="datetime"
                style="width: 180px"
                value-format="yyyy-MM-dd HH:mm:ss"
                placeholder="下单时间结束"
                default-time="23:59:59">
        </el-date-picker>
        <el-button  type="primary" @click="query" plain size="small" icon="el-icon-search">查询</el-button>
        <el-button  type="primary" @click="reset"  plain size="small" icon="el-icon-refresh">重置</el-button>
        <el-button type="danger" plain size="small" icon="el-icon-tickets" @click="openReceviceMoney">订单收银</el-button>
        </el-row>
        <!--<el-row style="margin-top: 20px" >

        </el-row>-->

        <!--订单列表-->
        <el-table size="mini" :data="orderData"
                  @selection-change="handleOrderSelection"
                  border style="width: 100%;margin-top: 20px">

            <el-table-column type="index" label="序号"></el-table-column>
            <el-table-column
                    type="selection"
                    width="55">
            </el-table-column>
            <el-table-column type="expand">
                <template slot-scope="props" >
                    <el-table
                            size="small"
                            :data="props.row.erpOrderItemEntityList"
                            style="width: 100%">
                        <el-table-column
                                type="index"
                                width="50"
                                label="序号">
                        </el-table-column>
                        <el-table-column label="商品名称" prop="name"></el-table-column>
                        <el-table-column label="规格/尺寸/材质/工艺"    prop="addon"></el-table-column>
                        <el-table-column label="数量"    prop="nums"></el-table-column>
                        <el-table-column label="份数"    prop="copy"></el-table-column>
                        <el-table-column label="单价"    prop="price"></el-table-column>
                        <el-table-column label="总价"    prop="amount"></el-table-column>
                        <el-table-column label="备注"    prop="itemRemark"></el-table-column>
                    </el-table>
                </template>
            </el-table-column>
            <el-table-column prop="orderNo" label="订单号" >
                <template slot-scope="scope">
                    <a href="javascript:;" @click="twbMonthOrderVm.erpOrderDetail(scope.row.orderNo)">{{scope.row.orderNo}}</a>
                    <!--<el-button
                            size="small"
                            type="text"
                            @click="erpOrderDetail(scope.$index, scope.row.orderNo)">{{scope.row.orderNo}}</el-button>-->
                </template>
            </el-table-column>

            <el-table-column prop="memberName" label="客户名称"></el-table-column>

            <el-table-column prop="shipName" label="联系人"></el-table-column>

            <el-table-column prop="productionStatus" label="生产状态"  :formatter="formatterProdStatus" ></el-table-column>

            <el-table-column prop="payStatus" label="付款状态" :formatter="formatterPayStatus"></el-table-column>

            <el-table-column prop="payableAmount" label="订单应付金额" ></el-table-column>

            <el-table-column prop="orderCreatetime" label="下单时间"></el-table-column>

            <el-table-column prop="projectName" label="项目名称"></el-table-column>

        </el-table>
        <!--分页插件-->
        <div style="text-align: center;margin: 15px">
            <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="page.currentPage"
                    :page-sizes="page.pageSizes"
                    :page-size="page.pageSize"
                    layout="total, sizes, prev, pager, next"
                    :total="page.total">
            </el-pagination>
        </div>
    </div>

    <el-dialog title="确认收款" :visible.sync="monthMoneyVisible" width="500px" size="small">
        <el-form :model="moneyForm">
            <el-form-item label="客户名称" :label-width="formLabelWidth">
                    <span> {{moneyForm.memberName}}</span>
            </el-form-item>

            <el-form-item label="订单数" :label-width="formLabelWidth">
                 <span> {{moneyForm.orderCount}}</span>
            </el-form-item>

            <el-form-item label="支付方式" :label-width="formLabelWidth">
                <el-select v-model="moneyForm.payment" placeholder="请选择支付方式" size="small">
                    <el-option
                            v-for="item in payTypeData"
                            :key="item.id"
                            :label="item.describe"
                            :value="item.describe">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="订单总金额" :label-width="formLabelWidth">
                <el-input-number v-model="moneyForm.payableAmount" controls-position="right" size="small"  :min="0"></el-input-number>&nbsp;&nbsp;元
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="cancel" size="small">取 消</el-button>
            <el-button type="primary" @click="save" size="small">确 定</el-button>
        </div>
    </el-dialog>

</div>

<script src="${request.contextPath}/statics/js/modules/order/twbMonthOrder.js?_${.now?long}"></script>
</body>
</html>